Skip to content

Conversation

@arunjose696
Copy link
Contributor

When setting a null image on a MenuItem, the existing bitmap handle was overwritten with 0 without being released, causing a GDI handle leak if the MenuItem previously had an icon. This commit makes sure the handle is always deleted if it was set before.

Steps to reproduce
1)Open a Runtime workspace
2)Double click(or open) a file in the Package explorer
3)Compare the GDI handles in the task manager before and after; it increases by 3 without this fix

This regression was introduced in #1914. The fix ensures that old handles are properly deleted before being replaced.

When setting a null image on a MenuItem, the existing bitmap handle was overwritten with 0 without being released, causing a GDI handle leak if the MenuItem previously had an icon. This commit makes sure the handle is always deleted if it was set before.
@github-actions
Copy link
Contributor

Test Results

  118 files  ±0    118 suites  ±0   9m 57s ⏱️ -26s
4 432 tests ±0  4 409 ✅  - 1  17 💤 ±0  6 ❌ +1 
  298 runs  ±0    288 ✅  - 1   4 💤 ±0  6 ❌ +1 

For more details on these failures, see this check.

Results for commit f9efe01. ± Comparison against base commit a479377.

@arunjose696
Copy link
Contributor Author

Failed tests have been raised as an issue already #2516

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix totally makes sense and works as expected.

@HeikoKlare HeikoKlare merged commit 306966b into eclipse-platform:master Sep 22, 2025
15 of 17 checks passed
@HeikoKlare HeikoKlare deleted the arunjose696/444/handleleak branch September 22, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle leak when opening editors from package explorer

3 participants